package com.summer.framework.api.feign.factory.stream;

import com.summer.framework.api.dto.Msg;
import com.summer.framework.api.feign.fallback.stream.StreamApiServiceFallBack;
import com.summer.framework.api.feign.service.stream.StreamApiService;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * @auther: 杨杰
 * @date: 2019/5/13 14:10
 * @description:
 */
@Component
@Slf4j
public class StreamApiServiceFactory implements FallbackFactory<StreamApiServiceFallBack> {

    @Override
    public StreamApiServiceFallBack create(Throwable throwable) {
        StreamApiServiceFallBack fallBack = new StreamApiServiceFallBack();
        fallBack.setCause(throwable);
        return fallBack;
    }
}
